<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
/*******basic*******/
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$content=$postdata['demomcptoken'];
		if(!$content){
			exi('请输入MCP接入点','error');
		}
		$this->plugin_setting('basic',$postdata);
		$agent=array(
			'title'=>'demo测试',
			'alias'=>'demo测试',
			'mcpurl'=>$content,
		);
		$msg=$this->model('mcp')->bindMcpEndpoint($agent,1);
		exi('MCP接入成功:'.$msg);
	}
	$return['item']=$this->plugin_setting('basic');
	$htmls=array(
		'type'=>'edit',
		'desc'=>'MCP接入点测试',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'MCP接入点测试',
				'list'=>array(
					array('type'=>'text','title'=>'MCP接入点','name'=>'demomcptoken','help'=>''),
				)
			),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}
